#include <D3D11.h>
#include <xnamath.h>

#ifndef CAMERA_H
#define CAMERA_H

namespace DirectX
{
  class CameraDevice
  {
  public:
    CameraDevice(void);
    virtual ~CameraDevice(void);

    void Reset();

    void MoveForward(float units);
    void MoveUp(float units);
    void Strafe(float units);

    void SetYaw(float units);
    float GetYaw();
    void SetPitch(float units);
    float GetPitch();
    void SetRoll(float units);
    float GetRoll();

    void Update();

    void SetPosition(XMFLOAT3 pos);
    XMVECTOR GetPosition();

    void SetLookAt(XMFLOAT3 target);
    XMVECTOR GetLookAt();

    void SetFOV(float fov);
    float GetFOV();
    void SetAspect(float aspect);
    float GetAspect();

    void SetNear(float value);
    float GetNear();
    void SetFar(float value);
    float GetFar();

    XMMATRIX GetView();

    XMMATRIX GetProjection();

    XMVECTOR GetDirection()
    {
      return XMLoadFloat3(&m_direction);
    }

  private:
    void CreateProjectionMatrix(float fov, float aspect, float nearPlane, float farPlane);

    XMFLOAT4X4 m_view, m_proj;
    XMFLOAT3 m_strafe, m_pos, m_target, m_up, m_velocity, m_direction;
    float m_yaw, m_pitch, m_roll, m_fov, m_aspect, m_near, m_far;

  };
}
#endif